<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE topic
  PUBLIC "-//OASIS//DTD DITA Composite//EN" "ditabase.dtd">
<topic id="topic1"><title id="dg20941">DROP SCHEMA</title><body><p id="sql_command_desc">Removes a schema.</p><section id="section2"><title>Synopsis</title><codeblock id="sql_command_synopsis">DROP SCHEMA [IF EXISTS] <varname>name</varname> [, ...] [CASCADE | RESTRICT]</codeblock></section><section id="section3"><title>Description</title><p><codeph>DROP SCHEMA</codeph> removes schemas from the database. A schema can only be dropped by
        its owner or a superuser. Note that the owner can drop the schema (and thereby all contained
        objects) even if he does not own some of the objects within the schema.</p></section><section id="section4"><title>Parameters</title><parml><plentry><pt>IF EXISTS</pt><pd>Do not throw an error if the schema does not exist. A notice is issued
in this case.</pd></plentry><plentry><pt><varname>name</varname></pt><pd>The name of the schema to remove.</pd></plentry><plentry><pt>CASCADE</pt><pd>Automatically drops any objects contained in the schema (tables,
functions, etc.). </pd></plentry><plentry><pt>RESTRICT</pt><pd>Refuse to drop the schema if it contains any objects. This is the
default. </pd></plentry></parml></section><section id="section5"><title>Examples</title><p>Remove the schema <codeph>mystuff</codeph> from the database, along with everything it contains: </p><codeblock>DROP SCHEMA mystuff CASCADE;</codeblock></section><section id="section6"><title>Compatibility</title><p><codeph>DROP SCHEMA</codeph> is fully conforming with the SQL standard,
except that the standard only allows one schema to be dropped per command.
Also, the <codeph>IF EXISTS</codeph> option is a Greenplum Database extension.</p></section><section id="section7"><title>See Also</title><p><codeph><xref href="CREATE_SCHEMA.xml#topic1" type="topic" format="dita"/></codeph>,
            <codeph><xref href="ALTER_SCHEMA.xml#topic1" type="topic" format="dita"/></codeph></p></section></body></topic>
